import time
from selenium.webdriver.common.by import By


def column(driver):
    driver.find_element(By.XPATH, "//*[@id='leftbaraside']/div[2]/nav/ul/li[4]/a").click()
    driver.find_element(By.XPATH, "//*[@id='leftbaraside']/div[2]/nav/ul/li[4]/ul/li[3]/a").click()
    time.sleep(1.5)

def add_card(driver, bank, card):
    driver.find_element(By.ID, "bankCard_add_modal_btn").click()
    driver.find_element(By.ID, "cardBank_add_input").send_keys(bank)
    driver.find_element(By.ID, "cardNum_add_input").send_keys(card)
    time.sleep(1)
    driver.find_element(By.XPATH, "//*[@id='bankCard_save_btn']").click()
    time.sleep(1)

def update_cardBank(driver, bank):
    driver.find_element(By.XPATH,
                        "/html/body/div/div/main/div/div/div[2]/div/div/div[1]/ul/li/button[1]").click()
    driver.find_element(By.ID, "cardBank_update_input").clear()
    driver.find_element(By.ID, "cardBank_update_input").send_keys(bank)
    driver.find_element(By.ID, "bankCard_update_btn").click()
    time.sleep(1)

def update_cardNum(driver, card):
    driver.find_element(By.XPATH,
                             "/html/body/div/div/main/div/div/div[2]/div/div/div[1]/ul/li/button[1]").click()
    driver.find_element(By.ID, "cardNum_update_input").clear()
    driver.find_element(By.ID, "cardNum_update_input").send_keys(card)
    driver.find_element(By.ID, "bankCard_update_btn").click()
    time.sleep(1)